#pragma once

#include "mvItemRegistry.h"

namespace Marvel {

	MV_REGISTER_WIDGET(mvViewportDrawlist, MV_ITEM_DESC_CONTAINER | MV_ITEM_DESC_ROOT, StorageValueTypes::None, 1);
	class mvViewportDrawlist : public mvAppItem
	{

	public:

		static void InsertParser(std::map<std::string, mvPythonParser>* parsers);

		MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvViewportDrawlist, add_viewport_drawlist)
		MV_NO_COMMANDS
		MV_DEFAULT_PARENTS
		MV_NO_CONSTANTS

		MV_START_CHILDREN
			MV_ADD_CHILD(mvAppItemType::mvDrawLine),
			MV_ADD_CHILD(mvAppItemType::mvDrawArrow),
			MV_ADD_CHILD(mvAppItemType::mvDrawTriangle),
			MV_ADD_CHILD(mvAppItemType::mvDrawCircle),
			MV_ADD_CHILD(mvAppItemType::mvDrawEllipse),
			MV_ADD_CHILD(mvAppItemType::mvDrawBezierCubic),
			MV_ADD_CHILD(mvAppItemType::mvDrawBezierQuadratic),
			MV_ADD_CHILD(mvAppItemType::mvDrawQuad),
			MV_ADD_CHILD(mvAppItemType::mvDrawRect),
			MV_ADD_CHILD(mvAppItemType::mvDrawText),
			MV_ADD_CHILD(mvAppItemType::mvDrawPolygon),
			MV_ADD_CHILD(mvAppItemType::mvDrawPolyline),
			MV_ADD_CHILD(mvAppItemType::mvDrawImage)
		MV_END_CHILDREN

	public:

		mvViewportDrawlist(mvUUID uuid);

		void draw(ImDrawList* drawlist, float x, float y) override;
		void handleSpecificKeywordArgs(PyObject* dict) override;
		void getSpecificConfiguration(PyObject* dict) override;
		void applySpecificTemplate(mvAppItem* item) override;

	private:

		bool _front = true;

	};
}